package cn.JHai.service.impl;

import cn.JHai.dao.FavoritesDao;
import cn.JHai.domain.Favorite;
import cn.JHai.service.FavoritesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service("favoritesServiceImp")
public class FavoritesServiceImp implements FavoritesService {

    @Autowired
    FavoritesDao favoritesDao;

    @Override
    public boolean save(Favorite favorite) {
        return favoritesDao.save(favorite);
    }

    @Override
    public ArrayList<Favorite> findAll() {
        return favoritesDao.findAll();
    }

    @Override
    public ArrayList<Favorite> findWithUid(int uid) {
        return favoritesDao.findWithUid(uid);
    }

    @Override
    public Favorite find(String mid) {
        return favoritesDao.find(mid);
    }

    @Override
    public ArrayList<Favorite> findfavorite(String name) {
        return favoritesDao.findfavorite(name);
    }

    @Override
    public boolean delete(String mid) {
        return favoritesDao.delete(mid);
    }

    @Override
    public boolean update(Favorite favorite) {
        return favoritesDao.update(favorite);
    }
}
